/*
 * Rhy placeholder emulation
 *
 * @author Tristan Maindron
 * @dependencies rhy.core.wrapper, rhy.core.browser
 * 
 */

Rhy.extra.placeholder = {
    apply: function(input){        
        if(Rhy.browser.isInternetExplorer() && Rhy.browser.getIExplorerVersion() < 10){
            input.placeholder = input.getAttribute('placeholder');
            input.value = input.placeholder;
            Rhy.on(input, 'focus', function(){
                if(input.value == input.placeholder){
                    input.value = '';
                }
            });
            
            Rhy.on(input, 'blur', function(){
                if(input.value == ''){
                    input.value = input.placeholder;
                }
            });
        }
    }
};
